/**
 * 文档作者: wj
 * 创建时间：2018年05月04日
 * 修改时间：2018年05月04日
 * 描述信息：tabbar组件(底部导航栏)
 */
import React, {Component} from 'react';
import './card.scss';

class Card extends Component {
    constructor(props) {
        super(props);
        this.onUpgrade = this.props.onUpgrade;
        this.data = props.data;
    }
    render() {
        return (
            <div className={Number(this.data&&this.data.isMember) === 0 ? 'component-card blue' : 'component-card yellow'}>
                <div className='top both-sides'>
                    <div><div className='img'></div><span className='grade'>{Number(this.data&&this.data.isMember) === 0 ? '非会员卡' : '会员卡'}</span></div>
                    <span style={{"display":this.data.isMember === '0' ? '': 'none'}} onClick={this.onUpgrade} className='green'>立即升级&nbsp;></span>
                </div>
                <div className='bottom'>
                    <p>姓&nbsp;&nbsp;&nbsp;名: <span>{this.data.wx_nickname}</span></p>
                    <p>手机号:<span>{this.data.cellno ? this.data.cellno : '请先绑定手机号'}</span></p>
                    <p>会员号:<span>{this.data.uid}</span></p>
                    <p>积分值:<span>{this.data.n_jifen}</span></p>
                </div>
            </div>
        )
    }
}

export default Card;

